Usage

Usage: pucrunch [-flags] [infile [outfile]]
     cval    machine: 
     a         avoid video matrix (for VIC20)
     d         data (no loading address)
     lval    set/override load address
     xval    set execution address
     eval    force escape bits
     rval    restrict lz search range
    +f         disable fast mode
    -ffast     select the faster but longer decompressor, if available
    -fshort    select the shorter but slower decompressor, if available
    -fdelta    use waveform matching
     n         no RLE/LZ length optimization
     s         full statistics
     pval    force extralzposbits
     mval    max len 5..7 (64/128/256)
     ival    interrupt enable after decompress (0=disable)
     gval    memory configuration after decompress
     u         unpack

Pucrunch expects any number of options and upto two filenames. If you only give one filename, the compressed file is written to the stardard output. If you leave out both filenames, the input is in addition read from the stardard input. Options needing no value can be grouped together. All values can be given in decimal (no prefix), octal (prefix 0), or hexadecimal (prefix $ or 0x).

Example: pucrunch demo.prg demo.pck -m6 -fs -p2 -x0xc010

Option descriptions:

cval
    Selects the machine. Possible values are 128(C128), 64(C64), 20(VIC20), 16(C16/Plus4), 0(standalone). The default is 64, i.e. Commodore 64. If you use -c0, a packet without the embedded decompression code is produced. This can be decompressed with a standalone routine and of course with pucrunch itself. The 128-mode is not fully developed yet. Currently it overwrites memory locations $f7-$f9 (Text mode lockout, Scrolling, and Bell settings) without restoring them later.

a
    Avoids video matrix if possible. Only affects VIC20 mode.

d
    Indicates that the file does not have a load address. A load address can be specified with -l option. The default load address if none is specified is 0x258.

lval
    Overrides the file load address or sets it for data files.

xval
    Sets the execution address or overrides automatically detected execution address. Pucrunch checks whether a SYS-line is present and tries to decode the address. Plain decimal addresses and addresses in parenthesis are read correctly, otherwise you need to override any incorrect value with this option.

eval
    Fixes the number of escape bits used. You don't usually need or want to use this option.

rval
    Sets the LZ77 search range. By specifying 0 you get only RLE. You don't usually need or want to use this option.

+f
    Disables 2MHz mode for C128 and 2X mode in C16/+4.

-ffast
    Selects the faster, but longer decompressor version, if such version is available for the selected machine and selected options. Without this option the medium-speed and medium-size decompressor is used.

-fshort
    Selects the shorter, but slower decompressor version, if such version is available for the selected machine and selected options. Without this option the medium-speed and medium-size decompressor is used.

-fdelta
    Allows delta matching. In this mode only the waveforms in the data matter, any offset is allowed and added in the decompression. Note that the decompressor becomes 22 bytes longer if delta matching is used and the short decompressor can't be used (24 bytes more). This means that delta matching must get more than 46 bytes of total gain to get any net savings. So, always compare the result size to a version compressed without -fdelta.

    Also, the compression time increases because delta matching is more complicated. The increase is not 256-fold though, somewhere around 6-7 times is more typical. So, use this option with care and do not be surprised if it doesn't help on your files.

n
    Disables RLE and LZ77 length optimization. You don't usually need or want to use this option.

s
    Display full statistics instead of a compression summary.

pval
    Fixes the number of extra LZ77 position bits used for the low part. If pucrunch tells you to to use this option, see if the new setting gives better compression.

mval
    Sets the maximum length value. The value should be 5, 6, or 7. The lengths are 64, 128 and 256, respectively. If pucrunch tells you to to use this option, see if the new setting gives better compression. The default value is 7.

ival
    Defines the interrupt enable state to be used after decompression. Value 0 disables interrupts, other values enable interrupts. The default is to enable interrupts after decompression.

gval
    Defines the memory configuration to be used after decompression. Only used for C64 mode (-c64). The default value is $37.

u
    Unpacks/decompresses a file instead of compressing it. The file to decompress must have a decompression header compatible with one of the decompression headers in the current version.

Note: Because pucrunch contains both RLE and LZ77 and they are specifically designed to work together, DO NOT RLE-pack your files first, because it will decrease the overall compression ratio.